package com.yfqy.app.domain.mapper;

import com.yfqy.app.domain.entity.ShoppingCart;
import com.yfqy.app.modules.system.vo.CartSelectStats;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShoppingCartMapper {

    int insert(ShoppingCart record);

    ShoppingCart selectByPrimaryKey(Long id);

    ShoppingCart selectByCustomerSkuPurchasedStatus(@Param("userId") Long userId, @Param("skuId") Long skuId);

    int updateQuantity(@Param("id") Long id, @Param("quantity") int quantity);

    ShoppingCart selectByIdAndCustomer(@Param("id") Long id, @Param("userId") Long userId);

    int deleteById(Long id);

    List<ShoppingCart> selectByCustomer(Long userId);

    int updateSelectedStatus(@Param("id") Long id, @Param("selected") byte selected);

    CartSelectStats selectCartSelectStats(@Param("userId") Long userId);

    int updateAllSelectedStatus(@Param("userId") Long userId, @Param("selected") boolean selected);
}